s = [str(i) for i in range(10)]

# 递归
def p(pre, deep):
    if deep == 0:
        print(pre, end=',')
        return
    for c in s:
        p(pre+c, deep-1)

if __name__ == '__main__':
    n = 4
    for i in range(n):
        for j in s[1:]:
            p(j, i)
